<!--编辑企业用户-->
<template>
	<div>
		<el-tabs v-model="activeName2" type="card" >
			<el-tab-pane label="企业信息" name="first">
				<el-row>
					<el-col :span="6"><h2>基础资料</h2></el-col>

				</el-row>
				<!--<p>点击上传图片</p>-->
				<!--<el-upload-->
				<!--class="upload-demo"-->
				<!--:action="fileUploadAction"-->
				<!--:on-preview="handlePreview"-->
				<!--:on-remove="handleRemove"-->
				<!--:file-list="fileList2"-->
				<!--list-type="picture">-->
				<!--<el-button size="small" type="primary">点击上传</el-button>-->
				<!--<div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>-->
				<!--</el-upload>-->
				<!--<el-upload-->
						<!--class="avatar-uploader"-->
						<!--:action="fileUploadAction"-->
						<!--:show-file-list="false"-->
						<!--:on-remove="handleRemove"-->
						<!--:on-success="handleAvatarSuccess"-->
						<!--:before-upload="beforeAvatarUpload">-->
					<!--<img v-if="imageUrl" :src="imageUrl" class="avatar">-->
					<!--<i v-else class="el-icon-plus avatar-uploader-icon"></i>-->
				<!--</el-upload>-->
				<!--<el-button type="text" v-if="imageUrl" style="margin-left:25px" @click="paramFileRemove">删除图片</el-button>-->
				<el-form  ref="form" :model="form" label-width="80px" :rules="rules">
					<!--企业名称-->
					<el-form-item label="企业名称" prop="enterprise_name">
						<el-input v-model="form.enterprise_name" style="width:220px" ></el-input>
					</el-form-item>
					<el-form-item label="企业类型" prop="enterprise_type">
						<el-select v-model="form.enterprise_type">
							<el-option :label="item.name" :value="item.id" v-for="item in ComtypeMessage"></el-option>
						</el-select>
					</el-form-item>
					<!--上市情况-->
					<el-row >
						<el-col :span="8">
							<el-form-item label="上市情况" prop="is_list">
								<el-select v-model="form.is_list">
									<el-option :label="item.name" :value="item.id" v-for="item in shMessage"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item prop="stock_code" label="股票代码" v-if="form.is_list!=''&&form.is_list!='11'">
								<el-input v-model="form.stock_code"  placeholder="请输入股票代码"></el-input>
							</el-form-item>
						</el-col>

					</el-row>
					<!--技术路径-->
					<!--<el-form-item label="技术路径" prop="">-->
						<!--<el-select v-model="form.is_list">-->
							<!--<el-option :label="item.name" :value="item.id" v-for="item in shMessage"></el-option>-->
						<!--</el-select>-->
					<!--</el-form-item>-->
					<el-form-item label="联络状态" prop="contact_state" >
						<el-select v-model="form.contact_state">
							<el-option :label="item.name" :value="item.id" v-for="item in stateMessage"></el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="核心技术" prop="core_technology" >
						<el-input v-model="form.core_technology" style="width: 220px"></el-input>
					</el-form-item>
					<el-form-item label="经营范围" prop="manage_range" >
						<el-input v-model="form.manage_range" style="width: 220px"></el-input>
					</el-form-item>
					<!--涉及领域-->
					<el-form-item label="涉及领域" prop="involve_field">
						<el-checkbox-group v-model="form.involve_field">
							<el-checkbox :label="item.id" v-for="item in LyMessage">{{item.name}}</el-checkbox>
						</el-checkbox-group>
					</el-form-item>
					<el-form-item label="技术路径" prop="register_fund">
						<el-button type="primary" @click="settePath('addPath')">设置</el-button>
					</el-form-item>
					<el-form-item label="注册资金（万元）" prop="register_fund">
						<el-input v-model="form.register_fund" style="width: 220px" ></el-input>
					</el-form-item>
					<!--法人代表-->
					<el-form-item label="法人代表" prop="legal_person">
						<!--<el-input v-model="form.legal_person" style="width: 220px"></el-input>-->
						<el-select v-model="form.legal_person" filterable placeholder="请选择法人">
							<el-option :label="item.personal_name" :value="item.personal_id" v-for="item in manLists"></el-option>

						</el-select>
						<el-button type="primary" @click="openDialog('addFaren')">没有此人?去添加</el-button>
					</el-form-item>
					<el-form-item label="联系人" prop="contact_person">
						<el-select v-model="form.contact_person" filterable placeholder="请选择联系人">
							<el-option :label="item.personal_name" :value="item.personal_id" v-for="item in manLists"></el-option>
						</el-select>
						<el-button type="primary" @click="openDialog('addLinkman')">没有此人?去添加</el-button>
					</el-form-item>
					<!--企业地址三级连动 -->
					<el-form-item label="企业地址" prop="region">
						<el-select v-model="form.province" size="small" style="width:120px" @change="change()">
							<el-option :label="item.district" :value="item.district_id" v-for="item in provinceList" >
							</el-option>
							</el-option>
						</el-select>
						<el-select v-model="form.city" size="small" style="width:120px" @change="changeThree()" v-if="city.length">
							<el-option :label="item.district" :value="item.district_id" v-for="item in city"></el-option>
						</el-select>
						<el-select v-model="form.area" size="small" style="width:120px" v-if="city.length&&country.length">
							<el-option :label="item.district" :value="item.district_id" v-for="item in country"></el-option>
						</el-select>
					</el-form-item>
					<!--企业详细地址-->
					<el-form-item label="详细地址" prop="detail_address">
						<el-input v-model="form.detail_address" style="width: 220px"></el-input>
					</el-form-item>
					<el-row :gutter="20">
						<!--企业e-mail-->
						<el-col :span="8">
							<el-form-item label="企业E-mail" prop="enterprise_email" >
								<el-input v-model="form.enterprise_email" ></el-input>
							</el-form-item>
						</el-col>
						<!--企业电话-->
						<el-col :span="8">
							<el-form-item label="企业电话" prop="enterprise_phone">
								<el-input v-model="form.enterprise_phone" ></el-input>
							</el-form-item>
						</el-col>
						<!--企业传真-->
						<el-col :span="8">
							<el-form-item label="企业传真" prop="enterprise_fax">
								<el-input v-model="form.enterprise_fax" ></el-input>
							</el-form-item>
						</el-col>
					</el-row>
					<!--企业网址-->
					<el-form-item label="企业网址" prop="enterprise_website">
						<el-input v-model="form.enterprise_website" style="width: 220px"></el-input>
					</el-form-item>

						<!--公司介绍-->

							<el-form-item label="公司介绍" prop="company_introduce" >
								<el-input  type="textarea" :rows="3"  v-model="form.company_introduce" ></el-input>
							</el-form-item>
						</el-col>
						<!--评价-->
						<!--合作成果-->
						<el-form-item label="评价" prop="company_evaluate" >
							<el-input v-model="form.company_evaluate" style="width:500px"></el-input>
						</el-form-item>
					<el-form-item label="合作成果" prop="cooperate_achievements" >
						<el-input v-model="form.cooperate_achievements" style="width:500px"></el-input>
					</el-form-item>
					<!--跟进记录-->
					<el-form-item label="跟进记录" prop="follow_record" >
						<el-input v-model="form.follow_record" style="width:500px"></el-input>
					</el-form-item>
				</el-form>
				<!--添加法人-->
				<el-dialog title="添加法人" :visible.sync="dialog.addFaren.open" :modal="false" size="full" v-if="dialog.addFaren.open">
					<addMan></addMan>
				</el-dialog>
				<!--添加技术路径-->
				<el-dialog title="设置技术路径" :visible.sync="dialog.addPath.open" :modal="false"  v-if="dialog.addPath.open" top="400px" :close-on-click-modal="false" :show-close="false">
					<el-form>
					<el-form-item label="技术路径" prop="technical_path">
						<el-checkbox-group v-model="form.technical_path">
							<el-checkbox :label="item.id" v-for="item in techPath">{{item.name}}</el-checkbox>
						</el-checkbox-group>
					</el-form-item>
					</el-form>
					<el-button @click="nopath('addPath')">取消</el-button>
					<el-button type="primary" @click="surePath('addPath')">确定</el-button>
				</el-dialog>
				<!--联系人-->
				<el-dialog title="添加联系人" :visible.sync="dialog.addLinkman.open" :modal="false" size="full" v-if="dialog.addLinkman.open">
					<addMan></addMan>
				</el-dialog>
				<!--能力画像-->
				<h2>能力画像</h2>
				<el-tabs type="border-card">
					<el-tab-pane label="设计" >
						<template>
							<el-radio class="radio" v-model="form.has_design_ability" label="0">无设计能力</el-radio>
							<el-radio class="radio" v-model="form.has_design_ability" label="1">有设计能力</el-radio>
						</template>
						<editDesignable v-if="form.has_design_ability==1"></editDesignable>
					</el-tab-pane>
					<el-tab-pane label="咨询">
						<template>
							<el-radio class="radio" v-model="form.has_consult_ability" label="0">无咨询能力</el-radio>
							<el-radio class="radio" v-model="form.has_consult_ability" label="1">有咨询能力</el-radio>
						</template>
						<editConsultable v-if="form.has_consult_ability==1"></editConsultable>
					</el-tab-pane>
					<el-tab-pane label="承建">
						<template>
							<el-radio class="radio" v-model="form.has_construct_ability" label="0">无承建能力</el-radio>
							<el-radio class="radio" v-model="form.has_construct_ability" label="1">有承建能力</el-radio>
						</template>
						<editBuildable v-if="form.has_construct_ability==1"></editBuildable>
					</el-tab-pane>
					<el-tab-pane label="设备供应">
						<template>
							<el-radio class="radio" v-model="form.has_device_supply_ability" label="0">无设备供应能力</el-radio>
							<el-radio class="radio" v-model="form.has_device_supply_ability" label="1">有设备供应能力</el-radio>
						</template>
						<editDeviceable v-if="form.has_device_supply_ability==1"></editDeviceable>
					</el-tab-pane>
					<el-tab-pane label="投资">
						<template>
							<el-radio class="radio" v-model="form.has_invest_ability " label="0">无投资能力</el-radio>
							<el-radio class="radio" v-model="form.has_invest_ability " label="1">有投资能力</el-radio>
						</template>
						<editInvestable v-if="form.has_invest_ability==1"></editInvestable>
					</el-tab-pane>
					<el-tab-pane label="运维">
						<template>
							<el-radio class="radio" v-model="form.has_operation_ability" label="0">无运维能力</el-radio>
							<el-radio class="radio" v-model="form.has_operation_ability" label="1">有运维能力</el-radio>
						</template>
						<editOpsable v-if="form.has_operation_ability==1"></editOpsable>
					</el-tab-pane>
				</el-tabs>
				<el-row>
					<div style="margin: 10px auto;text-align: center">
						<el-button type="primary" size="large" @click="submitForm('form')">确定</el-button>
					</div>
				</el-row>
			</el-tab-pane>
			<!--&lt;!&ndash;附件栏内容编辑&ndash;&gt;-->
			<!--<el-tab-pane label="附件栏" name="fourth" >-->
				<!--<el-form  class="demo-form-inline" label-width="100px" :label-position="position">-->
					<!--<el-form-item label="营业执照">-->
						<!--<el-upload-->
								<!--class="upload-demo"-->
								<!--:on-success="handleChange0"-->
								<!--:action="fileUploadAction"-->
								<!--:on-remove="handleRemove"-->
								<!--:file-list="fileList0">-->
							<!--<el-button size="small" type="primary">点击上传</el-button>-->
							<!--<span>(最多一份)</span>-->
						<!--</el-upload>-->

					<!--</el-form-item>-->
					<!--&lt;!&ndash;财务报表&ndash;&gt;-->
					<!--<el-form-item label="财务报表">-->
						<!--<el-upload-->
								<!--class="upload-demo"-->
								<!--:on-success="handleChange1"-->
								<!--:action="fileUploadAction"-->
								<!--:on-remove="handleRemove"-->
								<!--:file-list="fileList1">-->
							<!--<el-button size="small" type="primary">点击上传</el-button>-->
							<!--<span>(最多一份)</span>-->
						<!--</el-upload>-->

					<!--</el-form-item>-->
					<!--<el-form-item label="照片">-->
						<!--<el-upload-->
								<!--class="upload-demo"-->
								<!--:on-success="handleChange2"-->
								<!--:action="fileUploadAction"-->
								<!--:on-remove="handleRemove"-->
								<!--:file-list="fileList2">-->
							<!--<el-button size="small" type="primary">点击上传</el-button>-->
							<!--<span>(最多一份)</span>-->
						<!--</el-upload>-->
					<!--</el-form-item>-->
					<!--&lt;!&ndash;名片&ndash;&gt;-->
					<!--<el-form-item label="名片">-->
						<!--<el-upload-->
								<!--:multiple="file"-->
								<!--class="upload-demo"-->
								<!--:on-success="handleChange3"-->
								<!--:action="fileUploadAction"-->
								<!--:on-remove="handleRemove"-->
								<!--:file-list="fileList3">-->
							<!--<el-button size="small" type="primary">点击上传</el-button>-->
							<!--<span>(最多六份)</span>-->
						<!--</el-upload>-->
					<!--</el-form-item>-->
					<!--&lt;!&ndash;其他附件&ndash;&gt;-->
					<!--<el-form-item label="其他附件">-->
						<!--<el-upload-->
								<!--:multiple="file"-->
								<!--class="upload-demo"-->
								<!--:on-success="handleChange4"-->
								<!--:action="fileUploadAction"-->
								<!--:on-remove="handleRemove"-->
								<!--:file-list="fileList4">-->
							<!--<el-button size="small" type="primary">点击上传</el-button>-->
							<!--<span>(最多六份)</span>-->
						<!--</el-upload>-->
					<!--</el-form-item>-->
				<!--</el-form>-->
			<!--</el-tab-pane>-->
		</el-tabs>
	</div>
</template>
<script>
	import _http from '@/components/common/http.vue'
	import _param from '@/components/common/param.vue'
	import Bus from '@/config/bus.js'
	import addMan from '@/components/cust/company/addMan.vue'
	import editDesignable from '@/components/cust/common/editAbleList/editDesignable.vue'
	import editConsultable from '@/components/cust/common/editAbleList/editConsultable.vue'
	import editBuildable from '@/components/cust/common/editAbleList/editBuildable.vue'
	import editDeviceable from '@/components/cust/common/editAbleList/editDeviceable.vue'
	import editInvestable from '@/components/cust/common/editAbleList/editInvestable.vue'
	import editOpsable from '@/components/cust/common/editAbleList/editOpsable.vue'
	export default {
		components:{editDesignable,editConsultable,editBuildable,editDeviceable,editInvestable,editOpsable,addMan},
		data() {
			return {
				stateMessage:'',
//                营业执照上传列表
				fileList0:[],
//                财务报表
				fileList1:[],
//                照片
				fileList2:[],
//                名片
				fileList3:[],
//                其他附件
				fileList4:[],
				position:'left',
				apiPort:{
					stateApi:'diction/getEnterpriseType',
					TijiaoApi:'original/enterprise/addEnterprise',
					//企业类型字典接口
					companytypeApi:'diction/getEnterpriseType',
					//                    #上市情况字典接口
					inmarketApi:'diction/getEnterpriseType',
					//                    涉及领域字典接口
					involvedfieldApi:'diction/getEnterpriseType',
//					区域字典
					Area:'diction/region',
//					个人列表地址
					manList:'ctm/v1/getPersonal',
//					添加提交接口
					submitApi:'original/enterprise/addEnterprise',
//					获取技术路径的接口
					getTech:'original/enterprise/getTechnicalPath'
				},
				//                文件上传路径封装
				fileUploadAction:_param.param.fileUploadUrl,
				rules: {
					enterprise_name: [
						{ required: true, message: '请输入企业名称', trigger: 'blur' },
					],
					detail_address: [
						{ required: true, message: '请输输入详细地址', trigger: 'blur' },
					],
					enterprise_type: [
						{ type:'number',required: true, message: '请选择企业类型', trigger: 'change' }
					],
					is_list: [
						{ type:'number',required: true, message: '请选择上市情况', trigger: 'change' }
					],
					manage_range: [
						{required: true, message: '请填写经营范围', trigger: 'blur' }
					],
					involve_field: [
						{ type: 'array', required: true, message: '请选择涉及领域', trigger: 'change' }
					],
//					contact_person: [
//						{ required: true, message: '请选择联系人', trigger: 'change' }
//					],
					enterprise_email: [
						{ required: true, message: '请填写企业E-mail', trigger: 'blur' },
						{ type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur,change' }
					],
					enterprise_phone: [
						{ required: true, message: '请填写企业电话', trigger: 'blur' }
					],
				},
//                本地文件路径
				imageUrl:'',
				techPath:[],
				radio1:'1',
				radio2:'1',
				radio3:'1',
				radio4:'1',
				radio5:'1',
				radio6:'1',
				activeName2: 'first',
				form:{
					follow_record:'',
					cooperate_achievements:'',
					company_evaluate:'',
					company_introduce:'',
					technical_path:[],
					stock_code:'',
					contact_state:'',
					core_technology:'',
					enterprise_name:'',
					enterprise_type:'',
					is_list:'',
					involve_field:[],
					manage_range:'',
					register_fund:'',
					legal_person:"",
					contact_person:'',
					detail_address:'',
					enterprise_email:'',
					enterprise_phone:'',
					enterprise_fax:'',
					enterprise_website:"",
					has_design_ability:'0',
					has_consult_ability:'0',
					has_construct_ability:'0',
					has_device_supply_ability:'0',
					has_invest_ability:'0',
					has_operation_ability:'0',
					province:'',
					city:'',
					area:'',
//					设计能力数据
					design_zizhi_type:'',
					design_zizhi_award_unit:'',
					design_zizhi_level:'',
					design_charge_standard:'',
					design_major_field:'',
					design_evaluate_star:'',
//					建造能力数据
					construct_zizhi_level:'',
					construct_award_unit:'',
					construct_charge_standard:'',
					construct_major_field:'',
					technology_team_resource:'',
					construct_main_business:'',
					construct_business_area:[],
					construct_assure_method:'',
					special_ability:[],
					construct_evaluate_star:'',
//					咨询能力数据
					consult_zizhi_type:'',
					consult_zizhi_level:'',
					consult_zizhi_award_unit:'',
					consult_charge_standard:'',
					consult_major_field:'',
					consult_evaluate_star:'',
//					设备能力数据
					main_equipment:[],
					enterprise_popularity:'',
					sh_network_cover_region:[],
					market_share:'',
					sale_way:[],
					device_evaluate_star:'',
//					运维能力数据
					operation_main_business:'',
					enterprise_advantage:'',
					operation_bc_ability:'',
					business_region:[],
					operation_evaluate_star:"",
//					投资能力数据
					invest_evaluate_star:''
				},
				dialog:{
					addPath:{
						open:false
					},
					addFaren:{
						open:false
					},
					addLinkman:{
						open:false
					},
					showHistory:{
						open:false
					}
				},
				//                涉及领域参数
				provinceList:'',
				cityList:'',
				countryList:'',
//                城市
				city:[],
//                县
				country:[],
				ComtypeMessage:'',
				shMessage:'',
				LyMessage:'',
				manLists:'',
				userid:''
			}
		},
		methods:{
			settePath(par){
				this.openDialog(par)
				var that = this
				var paramsLy = that.querystring.stringify({userid:that.userid,involve_field:that.form.involve_field})
				_http.axiosRequest(that,that.apiPort.getTech,paramsLy,(res)=>{
					console.log(res)
				that.techPath=res.data.data
				console.log(that.techPath)
			})

			},
			nopath(par){
				this.form.technical_path=[]
				this.closeDialog(par)
			},
//			添加技术路径
			surePath(par){
				this.closeDialog(par)


			},
			getMan(){
				var that = this
				var paramsLy = that.querystring.stringify({userid:that.userid})
				_http.axiosRequest(that,that.apiPort.manList,paramsLy,(res)=>{
					console.log("个人")
				that.manLists = res.data
				console.log(res.data)
			})
			},
			getDic(){
				var that = this
//				企业联络状态
				var stateCom={code:"contactState",userid:that.userid}
				var statesCom = that.querystring.stringify(stateCom)
				_http.axiosRequest(that,that.apiPort.stateApi,statesCom,(res)=>{
					that.stateMessage=res.data.data
			})
				//获取企业类型接口
				var paramCom={code:"qylx",userid:that.userid}
				var paramsCom = that.querystring.stringify(paramCom)
				_http.axiosRequest(that,that.apiPort.companytypeApi,paramsCom,(res)=>{
					that.ComtypeMessage=res.data.data
			})
				//上市情况接口
				var paramSh={code:"ssqk",userid:that.userid}
				var paramsSh = that.querystring.stringify(paramSh)
				_http.axiosRequest(that,that.apiPort.inmarketApi,paramsSh,(res)=>{
					that.shMessage=res.data.data
			})
				var paramLy={code:"sjly",userid:that.userid}
				var paramsLy = that.querystring.stringify(paramLy)
				_http.axiosRequest(that,that.apiPort.involvedfieldApi,paramsLy,(res)=>{
					console.log("sjly")
				console.log(res)
				that.LyMessage=res.data.data
				console.log(that.LyMessage)
			})
				_http.axiosRequest(that,that.apiPort.Area,{},(res)=>{
					console.log("地址")
					console.log(res.data.data)
				this.provinceList = res.data.L0
				this.cityList = res.data.L1
				this.countryList = res.data.L2
			})
//				个人用户列表获取
				var paramsLy = that.querystring.stringify({userid:that.userid})
				_http.axiosRequest(that,that.apiPort.Area,paramsLy,(res)=>{
					console.log("地址")
				console.log(res.data.data)
				this.provinceList = res.data.L0
				this.cityList = res.data.L1
				this.countryList = res.data.L2
//
			})
				var paramsLy = that.querystring.stringify({userid:that.userid})
				_http.axiosRequest(that,that.apiPort.manList,paramsLy,(res)=>{
					console.log("个人")
				that.manLists = res.data
				console.log(res.data)
			})
			},
//            头像上传
			beforeUpload0(file){
//                console.log(this.fileList0)
//                console.log(file)
			},
//            change事件
			handleChange0(response,file, fileList) {
//                console.log(fileList)
				this.fileList0 = fileList.slice(-1);
				console.log(this.fileList0)
			},
			handleChange1(response,file, fileList) {
//                console.log(fileList)
				this.fileList1 = fileList.slice(-1);
				console.log(this.fileList0)
			},
			handleChange2(response,file, fileList) {
//                console.log(fileList)
				this.fileList2 = fileList.slice(-1);
				console.log(this.fileList0)
			},
			handleChange3(response,file, fileList) {
//                console.log(fileList)
				this.fileList3 = fileList.slice(-6);
				console.log(this.fileList0)
			},
			handleChange4(response,file, fileList) {
//                console.log(fileList)
				this.fileList4 = fileList.slice(-6);
				console.log(this.fileList4)
			},
//            财务报表
			Success(res, file) {
//                console.log(res)
			},
//          获取城市
			change(){
				this.form.city=''
				this.form.area=''
				this.city=[]
				for(var a in this.cityList){
					if(this.form.province==this.cityList[a].pid){
						this.city.push(this.cityList[a])
					}
				}
			},
//            获取县级别
			changeThree(){
				this.form.area=''
				this.country=[]
				for(var a in this.countryList){
					if(this.form.city==this.countryList[a].pid){
						this.country.push(this.countryList[a])
					}
				}
			},
			//            获取地址数据接口
			submitForm(formName) {

				var that = this
//				this.commitFlag()
				this.$refs[formName].validate((valid) => {
					console.log('所有数据')
					console.log(that.form)
				  if (valid) {
						var paramForm = that.querystring.stringify(that.form)
						_http.axiosRequest(that,that.apiPort.TijiaoApi,paramForm,(res)=>{
							console.log(res)
							if(res.data.code==100){
						that.$message({
							message: '新增成功',
							type: 'success'
						});
						setTimeout(function(){
									Bus.$emit('closeA',1)
								},200)
					}else {
								that.$message({
									message:res.data.msg,
									type: 'warning'
								});
							}
					})
					}
			});
			},
			handleRemove(){
			},
			handleAvatarSuccess(res, file) {
				console.log(res)
				console.log(file)
				this.imageUrl = URL.createObjectURL(file.raw);
			},
			beforeAvatarUpload(file) {
//                const isJPG = file.type === 'image/jpeg';
				const isLt2M = file.size / 1024 / 1024 < 2;
//                if (!isJPG) {
//                    this.$message.error('上传头像图片只能是 JPG 格式!');
//                }
				if (!isLt2M) {
					this.$message.error('上传头像图片大小不能超过 2MB!');
				}
				return  isLt2M;
			},
			openDialog(dialog){
				this.dialog[dialog].open = true
			},
			closeDialog(dialog){
				this.dialog[dialog].open = false
			},
			onSubmit() {
				console.log('submit!');
			},
			//            删除上传文件清空服务器上的内容
			paramFileRemove(){
				this.imageUrl=''
			},
//			提供标志
			commitFlag(){
				Bus.$emit('CommitFlag',1);
			}
		},
		mounted(){
			this.userid=localStorage.getItem('userId')
			this.form.userid = localStorage.getItem('userId')
			var that = this
//			建造能力数据
			Bus.$on('submitFormB',function(val){
				console.log("建造能力数据")
				that.form.construct_zizhi_level=val.construct_zizhi_level
				that.form.construct_award_unit=val.construct_award_unit
				that.form.construct_charge_standard=val.construct_charge_standard
				that.form.construct_major_field=val.construct_major_field
				that.form.technology_team_resource=val.technology_team_resource
				that.form.construct_main_business=val.construct_main_business
				that.form.construct_business_area=val.construct_business_area
				that.form.construct_assure_method=val.construct_assure_method
				that.form.special_ability=val.special_ability
				that.form.construct_evaluate_star=val.construct_evaluate_star
				that.form.construct_relation_person=val.construct_relation_person
				that.form.construct_relation_position=val.construct_relation_position

			})
//			设备能力数据
			Bus.$on('submitFormSb',function(val){
				console.log("设备能力数据")
				that.form.main_equipment=val.main_equipment
				that.form.enterprise_popularity=val.enterprise_popularity
				that.form.sh_network_cover_region=val.sh_network_cover_region
				that.form.market_share=val.market_share
				that.form.sale_way=val.sale_way
				that.form.device_evaluate_star=val.device_evaluate_star
				that.form.device_relation_person=val.device_relation_person
				that.form.device_relation_position=val.device_relation_position
				console.log('设备传来的数据')
				console.log(that.form.device_relation_person)
				console.log(that.form.device_relation_position)

			})
//			设计能力数据
			Bus.$on('submitFormD',function(val){
				console.log("设计能力数据")
				that.form.design_zizhi_type=val.design_zizhi_type
				that.form.design_zizhi_award_unit=val.design_zizhi_award_unit
				that.form.design_zizhi_level=val.design_zizhi_level
				that.form.design_charge_standard=val.design_charge_standard
				that.form.design_major_field=val.design_major_field
				that.form.design_evaluate_star=val.design_evaluate_star
				that.form.device_relation_person=val.device_relation_person
				that.form.device_relation_position=val.device_relation_position
			})
//			咨询能力数据
			Bus.$on('submitFormC',function(val){
				console.log("咨询能力数据")
				that.form.consult_zizhi_type=val.consult_zizhi_type
				that.form.consult_zizhi_level=val.consult_zizhi_level
				that.form.consult_zizhi_award_unit=val.consult_zizhi_award_unit
				that.form.consult_charge_standard=val.consult_charge_standard
				that.form.consult_major_field=val.consult_major_field
				that.form.consult_evaluate_star=val.consult_evaluate_star
				that.form.consult_relation_person=val.consult_relation_person
				that.form.consult_relation_position=val.consult_relation_position
			})
//			运维能力数据
			Bus.$on('submitFormO',function(val){
				console.log("运维能力数据")
				that.form.operation_main_business=val.operation_main_business
				that.form.enterprise_advantage=val.enterprise_advantage
				that.form.operation_bc_ability=val.operation_bc_ability
				that.form.business_region=val.business_region
				that.form.operation_evaluate_star=val.operation_evaluate_star
				that.form.operation_relation_person=val.operation_relation_person
				that.form.operation_relation_position=val.operation_relation_position
			})
//			投资能力数据
			Bus.$on('submitFormI',function(val){
				console.log("投资能力数据")
				that.form.invest_evaluate_star=val.invest_evaluate_star
				that.form.invest_relation_person=val.invest_relation_person
				that.form.invest_relation_position=val.invest_relation_position
			})
			  this.getDic()
			var that = this
//			Bus.$on('getTarget', function(val){
////                对象复制
//				that.form = Object.assign({}, val);
//			});
			Bus.$on('closeW',function(val){
				if(val==1){
					that.getMan()
					setTimeout(function(){
						console.log(1234)
						that.closeDialog('addFaren')
						that.closeDialog('addLinkman')
					},500)
				}
			})
		},
		beforeDestroy(){
			Bus.$off("submitFormD")
			Bus.$off("submitFormB")
			Bus.$off("submitFormC")
			Bus.$off("submitFormSb")
			Bus.$off("submitFormO")
			Bus.$off("submitFormI")
			Bus.$off("closeW")
		},
	}
</script>

<style>
	ul li{
		list-style: none;
		margin-top: 20px;
	}
	.listSty{
		display:inline-block;
		width: 100px
	}
	.mainListSty{
		display:inline-block;
		width: 100px;
		color: red;
	}
	.able:after{
		content: "√";
		color: #6ce26c;
	}
	.avatar-uploader .el-upload {
		border: 1px dashed #d9d9d9;
		border-radius: 6px;
		cursor: pointer;
		position: relative;
		overflow: hidden;
	}
	.avatar-uploader .el-upload:hover {
		border-color: #20a0ff;
	}
	.avatar-uploader-icon {
		font-size: 28px;
		color: #8c939d;
		width: 120px;
		height: 120px;
		line-height: 120px;
		text-align: center;
		margin-left: 10px;
	}
	.avatar {
		width: 120px;
		height: 120px;
		display: block;
	}
</style>